Conversation
Previously, build_all_external_dependencies() unconditionally called all build functions (build_hdf5, build_netcdf_c, etc.) regardless of which dependencies were actually needed. This caused CMake errors like "add_library cannot create imported target 'hdf5::hdf5' because another target with the same name already exists" when system HDF5/NetCDF were usable but only FFTW needed to be built from source. Now each build function is only called if its corresponding NEED_BUILD_* variable is TRUE. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add DOWNLOAD_EXTRACT_TIMESTAMP TRUE to HDF5 and FFTW ExternalProject_Add calls to silence CMP0135 policy warning - Add if(NOT TARGET) guards when creating HDF5 imported targets for extra robustness in case find_package already created them Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
PR Type
Bug fix
Description
Only build external dependencies that are actually needed
Add robustness guards to HDF5 imported target creation
Add DOWNLOAD_EXTRACT_TIMESTAMP to external project downloads
Diagram Walkthrough
File Walkthrough
BuildExternalDependencies.cmake
Conditional dependency building with target creation guardscmake/BuildExternalDependencies.cmake
build_fftw() function calls with conditional checks for NEED_BUILD_*
variables to only build dependencies that are actually needed
calls to prevent duplicate target errors when find_package already
created them
ExternalProject_Add calls to silence CMP0135 policy warnings
built